<?=$this->load->view('include_header',null)?>
<style type="text/css">
form#form textarea {
    height: 50px;
    overflow: auto;
    padding: 5px;
    width: 410px;
}
</style>
	<div id="top-panel">
		<div id="panel">
			<ul>
				<li class="current"><a href="<?=site_url('archive/idcard/'.$id)?>" class="report"><?=(empty($id))?"录入新":"编辑"?>客户基本信息</a></li>
				<?php if(!empty($info->id)):?><li><a id="printInfo" class="folder_table">打印本页信息</a></li><?php endif;?>
			</ul>
		</div>
	</div>
	<div id="wrapper">
		<div id="content">
			<div id="box">
<!-- table begin -->
<form method="post" id="form"  enctype="multipart/form-data" action="<?=site_url('schengen/vn_update/'.$cateid)?>">

	<h3>越南申请表</h3>
    <table width="100%">
    <thead>
        <tr>
          <td colspan="4" align="right"><img src="<?= (@$info->avatar)?@$info->avatar:'images/avatar.gif'?>" width="150" height="150" /></td>
		  <td align="right">
		  上传照片<br />
		  <input type="file" name="userphoto" /><br />
		  (.gif|.jpg|.png文件,最大1M)<br />
		  <?php if (@$info->attachment):?><a href="<?= @$info->attachment?>" target="_blank">点击下载附件</a><?php endif; ?>
		  &nbsp;&nbsp;&nbsp;&nbsp;上传附件<br />
		  <input type="file" name="userfile" /><br />
		  (.pdf|.zip|.rar|.doc,最大2M)		  </td>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td colspan="5" align="right">			
			<input type="hidden" name="id" value="<?=$id?>" />
			<input id="button1" type="submit" value="提交信息" />
			<input id="button2" type="reset" value="重置" />			</td>
        </tr>
    </tfoot>

    <tbody>
        <tr class="odd">
            <td>1-Họ và tên (Chữ in hoa):<br/>
姓名（英文大写）</td>
            <td><input type="text" name="name" value="<?= @$info->name?>" /></td>
            <td>&nbsp;</td>
            <td>2-Ngày sinh:<br/>出生日期</td>
            <td>
<select name="birth_y">
  <?php for($i=date("Y");$i>1940;$i--) echo "<option value='$i'".((@$info->birth_y==$i)?"selected":"").">$i</option>"; ?>
</select>-
<select name="birth_m">
  <?php for($i=1;$i<=12;$i++) echo "<option value='$i'".((@$info->birth_m==$i)?"selected":"").">$i</option>"; ?>
</select>-
<select name="birth_d">
  <?php for($i=1;$i<=31;$i++) echo "<option value='$i'".((@$info->birth_d==$i)?"selected":"").">$i</option>"; ?>
</select>

</td>
        </tr>
        <tr class="even">
            <td>3-Giới tính:<br/>性别</td>
            <td><input type="radio" name="sex" value="1" <?= (@$info->sex==1)?'checked':''?> />
              Male / 男
                <input type="radio" name="sex" value="2" <?= (@$info->sex==2)?'checked':''?> />
              Female / 女</td>
            <td>&nbsp;</td>
            <td>4-Nơi sinh:<br/>出生地</td>
            <td><input type="text" name="birth_place" value="<?= @$info->birth_place?>" /></td>
        </tr>
        <tr class="odd">
            <td>5-Quốc tịch gốc:<br/>原国籍</td>
            <td><input type="text" name="ori_nationality" value="<?= @$info->ori_nationality?>" /></td>
            <td>&nbsp;</td>
            <td>- Quốc tịch hiện tại:<br/>现在国籍</td>
            <td><input type="text" name="cur_nationality" value="<?= @$info->cur_nationality?>" /></td>
        </tr>
        <tr class="even">
            <td colspan="5">6-Hộ chiếu số:护照号码
              <input type="text" name="travel_document_num" value="<?= @$info->travel_document_num?>" />
              &nbsp;&nbsp;&nbsp;&nbsp;-Loại:护照种类
            <input type="text" name="travel_document_type" value="<?= @$info->travel_document_type?>" />
            <br />
Ngày cấp:发照日期 
<input type="text" name="travel_document_issue_date_y" value="<?= @$info->travel_document_issue_date_y?>" style="width:40px"/>年-
<input type="text" name="travel_document_issue_date_m" value="<?= @$info->travel_document_issue_date_m?>" style="width:20px"/>月-
<input type="text" name="travel_document_issue_date_d" value="<?= @$info->travel_document_issue_date_d?>" style="width:20px"/>日  &nbsp;&nbsp;&nbsp;&nbsp;Ngày hết hạn:无效日期 
<input type="text" name="travel_document_valid_date_y" value="<?= @$info->travel_document_valid_date_y?>" style="width:40px"/>年-
<input type="text" name="travel_document_valid_date_m" value="<?= @$info->travel_document_valid_date_m?>" style="width:20px"/>月-
<input type="text" name="travel_document_valid_date_d" value="<?= @$info->travel_document_valid_date_d?>" style="width:20px"/>日  
<br />Cơ quan cấp:发照单位 
<input type="text" name="travel_document_issue_by" value="<?= @$info->travel_document_issue_by?>" /></td>
        </tr>
        <tr class="odd">
            <td colspan="5">7-Nghề nghiệp:职业 
              <input type="text" name="occupation" value="<?= @$info->occupation?>" />
              <br />Nơi làm việc:工作单位 
              <input name="com_address" type="text" value="<?= @$info->com_address?>" style="width:300px" /> &nbsp;&nbsp;&nbsp;&nbsp;Số điện thoại:电话号码 
              <input type="text" name="com_tel" value="<?= @$info->com_tel?>" /></td>
        </tr>
        <tr class="even">
          <td colspan="5">8-Địa chỉ cư trú hiện nay:现在住址
			  <input name="home_address" type="text" value="<?= @$info->home_address?>" style="width:300px" />
&nbsp;&nbsp;&nbsp;&nbsp;Số điện thoại:联系电话 
<input type="text" name="home_tel" value="<?= @$info->home_tel?>" /></td>
        </tr>
        <tr class="odd">
            <td>9- Trẻ em cùng đi (họ tên, ngày sinh, quan hệ)随行儿童</td>
            <td colspan="4"><input name="child" type="text" value="<?= @$info->child?>" style="width:500px"/></td>
        </tr>
        <tr class="even">
            <td colspan="5">10-Mục đích nhập xuất cảnh:入境目的   
			<input type="radio" name="purpose" value="1" <?= (@$info->purpose==1)?'checked':''?>/> 经商 
            <input type="radio" name="purpose" value="2" <?= (@$info->purpose==2)?'checked':''?>/> 旅游
            <input type="radio" name="purpose" value="3" <?= (@$info->purpose==3)?'checked':''?>/> 探亲
            <input type="radio" name="purpose" value="4" <?= (@$info->purpose==4)?'checked':''?>/> 会议
            <input type="radio" name="purpose" value="5" <?= (@$info->purpose==5)?'checked':''?>/> 其他<br />
			Tên, địa chỉ cơ quan, tổ chức hoặc họ tên, quan hệ, địa chỉ của thân nhân ở Việt Nam Nơi vào làm việc hoặc thăm: 在越南的联系单位或亲属 (姓名、地址、电话)：<br/>
			<textarea name="contacter"><?= @$info->contacter?></textarea></td>
        </tr>
        <tr class="odd">
            <td>11-Thời gian dự kiến NXC Việt Nam<br/>赴越预计时间</td>
			<td colspan="4">Từ ngày:自 
<input type="text" name="arrival_date_y" value="<?= @$info->arrival_date_y?>" style="width:40px"/>年-
<input type="text" name="arrival_date_m" value="<?= @$info->arrival_date_m?>" style="width:20px"/>月-
<input type="text" name="arrival_date_d" value="<?= @$info->arrival_date_d?>" style="width:20px"/>日	  
  đến ngày:至  
<input type="text" name="departure_date_y" value="<?= @$info->departure_date_y?>" style="width:40px"/>年-
<input type="text" name="departure_date_m" value="<?= @$info->departure_date_m?>" style="width:20px"/>月-
<input type="text" name="departure_date_d" value="<?= @$info->departure_date_d?>" style="width:20px"/>日
			</td>
        </tr>
        <tr class="even">
            <td>12-Số lần nhập xuất cảnh:<br/>
			入境次数</td>
            <td><input type="text" name="entry_num" value="<?= @$info->entry_num?>"/></td>
            <td>&nbsp;</td>
            <td>13-Cửa khẩu NXC Việt Nam:<br/>入出境口岸</td>
            <td><input type="text" name="entry_port" value="<?= @$info->entry_port?>"/></td>
        </tr>
		        <tr class="odd">
            <td colspan="5">14-Tôi cam đoan những nội dung sau đây là đúng sự thật 本人保证上述资料属实。</td>
        </tr>
        <tr class="even">
            <td colspan="5">15- 
              <input type="radio" name="mail" value="0" <?= (@$info->mail==0)?'checked':''?>/>
              普通件		
              &nbsp;&nbsp;<input type="radio" name="mail" value="1" <?= (@$info->mail==1)?'checked':''?>/>
              加急件		</td>
            </td>
        </tr>		
        
    </tbody>
	</table>
<!-- table end -->
</form>

			</div>
		</div>
		
		<?=$this->load->view('include_sidebar',array('id'=>$id,'forms'=>$forms))?>
	</div>

<script type="text/javascript">
$().ready(function() {
  $("#form").validate({
    rules: {
		name:"required",
		sex:"required",
		birth_place:"required",
		cur_nationality:"required",
		travel_document_num:"required",
		travel_document_type:"required",
		travel_document_valid_date_y:"required",
		travel_document_valid_date_m:"required",
		travel_document_valid_date_d:"required",
		purpose:"required",
		mail:"required"
    }
  });
  
	$.datepicker.setDefaults(
		{
		dateFormat: 'yy/mm/dd',
		changeMonth: true,
		changeYear: true,
		showOn: "both",
		buttonImage: "images/calendar.gif",
		buttonImageOnly: true
		}
	);

	$("#travel_document_valid_date").datepicker();
	

	$("#printInfo").click(function(o) {
		var prints = [
			{rel_id: <?=$cateid?>, rec_id: <?=$id?>}
		]  ;
		
		var jdata = JSON.stringify(prints);
		//alert(jdata);
		$.post("<?=site_url('proxy/does/'.str_replace('==','',base64_encode('http://'.$_SERVER['SERVER_NAME'].':9090/javaprduct/servlet/test')))?>",{clients:jdata},function(msg){alert(msg)});
	});
	
	$("#printInfo").ajaxError(function(event,request, settings){
		//$(this).append("<li>出错页面:" + settings.url + "</li>");
		alert("无法访问"+ settings.url );
	}); 
 
});
</script>

<?=$this->load->view('include_footer',null)?>